]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: add some missing signal disconnections
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 9 Oct 2014 18:31:04 +0000 (14:31 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Mon, 13 Oct 2014 15:50:12 +0000 (11:50 -0400)
Disconnect some signal connections that weren't disconnected on actor destroy
(not the result of comprehensive review.)

https://bugzilla.gnome.org/show_bug.cgi?id=738256

js/ui/messageTray.js

index fb0b0ef41181954e36781aa4c79019811003ab53..cedb410eda603f3872140c360b04809e0da1abf3 100644 (file)
@@ -1159,6 +1159,7 @@ const SourceActor = new Lang.Class({
         this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
         this.actor.connect('allocate', Lang.bind(this, this._allocate));
         this.actor.connect('destroy', Lang.bind(this, function() {
+            this._source.disconnect(this._iconUpdatedId);
             this._actorDestroyed = true;
         }));
         this._actorDestroyed = false;
@@ -1170,7 +1171,7 @@ const SourceActor = new Lang.Class({
 
         this.actor.add_actor(this._iconBin);
 
-        this._source.connect('icon-updated', Lang.bind(this, this._updateIcon));
+        this._iconUpdatedId = this._source.connect('icon-updated', Lang.bind(this, this._updateIcon));
         this._updateIcon();
     },
 
@@ -1228,8 +1229,12 @@ const SourceActorWithLabel = new Lang.Class({
 
         this.actor.add_actor(this._counterBin);
 
-        this._source.connect('count-updated', Lang.bind(this, this._updateCount));
+        this._countUpdatedId = this._source.connect('count-updated', Lang.bind(this, this._updateCount));
         this._updateCount();
+
+        this.actor.connect('destroy', function() {
+            this._source.disconnect(this._countUpdatedId);
+        });
     },
 
     _allocate: function(actor, box, flags) {